import { PathFinderManager } from "../PathFinderManager";
 
import { ACostDecorate } from "./ACostDecorate";

/**
 * 自己房间的布局缓存寻路,一半用来寻找放路
 */
export class ACreepRoadPlan extends ACostDecorate
{
    decorate(manager:PathFinderManager,roomName: string, costs: CostMatrix,opt:IPathFinderOpt): CostMatrix 
    {
        const caches =   (manager as any)._stationinstace.PathCache.findRoomCache(roomName) as RoomPosition[];
        if(caches)
        {
            
            caches.forEach(e=>
                {
                    if(costs.get(e.x,e.y)<=1)
                    {
                        costs.set(e.x,e.y,1)}
                    });
        }
        else
        {
            //
        }
        return costs
    }

}